import { createI18n } from 'vue-i18n';
import zhCN from '../locales/zh-CN.json';
import enUS from '../locales/en-US.json';

const i18n = createI18n({
  legacy: false,
  globalInjection: true,
  locale: uni.getStorageSync('language') || 'zh-CN',
  fallbackLocale: 'zh-CN',
  fallbackWarn: false,
  missingWarn: false,
  messages: {
    'zh-CN': zhCN,
    'en-US': enUS
  }
});

export default i18n; 